package jblip.apps.clip.cmds;

import jblip.BlipClient;
import jblip.apps.clip.ClipPrinter;
import jblip.resources.Media;

public class GetRecording extends ClipCommand {

  @Override
  public void execute(BlipClient client, String[] args) {
    Integer id = Integer.parseInt(args[0]);
    Media rec = client.getRecording(id);
    if (client.getLastError() == null) {
      ClipPrinter.print(rec);
    } else {
      System.out.println("ERROR: " + client.getLastError());
    }
  }

  @Override
  public String getName() {
    return "getrec";
  }

  @Override
  public String getUsageMessage() {
    return "<message id>";
  }

}
